<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8"
	contentType="text/html;charset=utf-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<body>
	<h1>List Of LDAP Users</h1>
	<br />
	<a href="/LDAP/secure/LDAP_user/search">Rechercher un utilisateur</a>
	<br />
	<br />
	${message}
	<c:choose>
		<c:when test="${not empty users}">		
				<table>
				<tr>
					<th>Common Name</th>
					<th>Surname</th>
					<th colspan="3"></th>
					<!-- <th>Password</th> -->
				</tr>
				<c:forEach items="${users}" var="user">
					<tr>
						<td>${user.cn}</td>
						<td>${user.sn}</td>
						<!--<td>${user.pwd}</td>-->
						<% if (request.isUserInRole("ROLE_ADMIN")) { %>	
						<td><a href="/LDAP/secure/LDAP_user/delete/${user.cn}">DELETE</a>
						</td>
						 <%  } %>
					
						<td><a href="/LDAP/secure/LDAP_user/update/${user.cn}">EDIT</a>
						</td>
						<td><a href="/LDAP/secure/LDAP_user/details/${user.cn}">DETAILS</a>
						</td>
					</tr>
				</c:forEach>
			</table>
		</c:when>
		<c:otherwise>
			<p>Il n'y a pas d'utilisateurs</p>
		</c:otherwise>
	</c:choose>

	<a href="LDAP_user/new">Add New</a>
	

</body>
</html>